import java.util.Arrays;

public class Fanzhuan {

	public static void main(String[] args) {
//		​	已知一个数组 arr = {19, 28, 37, 46, 50}; 用程序实现把数组中的元素值交换，
//		​	交换后的数组 arr = {50, 46, 37, 28, 19}; 并在控制台输出交换后的数组元素
		int[]arr = {19, 28, 37, 46, 50};
		System.out.println("输出前：arr="+Arrays.toString(arr)+",");
		int[]bow=shuzu(arr);
		System.out.println("输出后：arr="+Arrays.toString(bow));
	}
	public static int[] shuzu(int[]arry) {
		int botto;
		for(int star=0,end=arry.length-1;arry[star]<arry[end];star++,end--) {
				botto=arry[end];
				arry[end]=arry[star];
				arry[star]=botto;	
			}	
			return arry;	
		}
		
	public static void shushu(int[]arrr) {
		System.out.println("{");
		for (int i = 0; i < arrr.length; i++) {
			if (i==arrr.length-1) {
				System.out.println(arrr[i]);
			} else {
				System.out.println(arrr[i]+",");
			}
		}
		System.out.println("}");
	}
}
